// pages/doctor/doctorDetail/detail.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    // 测试数据
    doc: {
      "image": "Default_lit.gif",
    },
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getDoctorAllInfoById(options.did);
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },

  /**
   * 根据id获取医生的完整信息
   */
  getDoctorAllInfoById(did) {
    let that = this;
    let urlBase = getApp().globalData.urlBase;

    wx.request({
      url: urlBase + '/wx/doctorInfo/' + did,
      method: 'get',
      header: {
        'content-type': 'application/json'
      },
      success(res) {
        let user = res.data.user;
        that.setData({
          doc: user,
        })
      }
    })
  }
})